package com.powersystem.demo.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.powersystem.demo.entity.PsLogs;
import com.powersystem.demo.service.IPsLogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.sql.Wrapper;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author linrongji
 * @since 2019-11-14
 */
@RestController
public class PsLogsController {
    @Autowired
    private IPsLogsService ipsLogsService;

    @RequestMapping("selectByLogsId")
    public List<PsLogs> selectByLogsId(int userId){
        IPage<PsLogs> ipage = new Page<>(0,4);
        QueryWrapper<PsLogs> wrapper = new QueryWrapper<>();
        return ipsLogsService.selectByUserId(userId);
    }
    @RequestMapping("selectByUserIdAndTime")
    public List<PsLogs> selectByUserIdAndTime(int id,String firstTime,String endTime){
        return ipsLogsService.selectByUserIdAndTime(id,firstTime,endTime);
    }


}

